package com.nbjtjc.safe.activiti.model;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.nbjtjc.safe.model.danger.DangerReformSheet;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @auther guqianbin
 * @date 2018/6/7 11:25
 **/
public class ActivitiParams {
    @ApiParam("任务分配的用户id")
    private Integer applyUserId;
    @ApiParam("0表示同意，1表示不同意")
    private Integer result;
    @ApiParam("是否需要审核")
    private Boolean  check;
    @ApiParam("是否有隐患")
    private Boolean danger;
    @ApiParam("是否需要评估")
    private Boolean evaluate;
    @ApiParam("隐患排查类型")
    private Integer type;
    @ApiParam("是否需要整改")
    private Boolean reform;
    @ApiParam("任务id")
    private String taskId;
    @ApiParam("流程实例id")
    private String processInstanceId;
    @ApiParam("流程定义id")
    private String processDefineId;
    @ApiParam("审核意见")
    private String comment;
    @ApiParam("是否需要督办")
    private Boolean supervise;
    @ApiParam("dangerInspectListIds")
    private ArrayList<Integer> userIds=new ArrayList<>();

    private DangerReformSheet dangerReformSheet;

    public DangerReformSheet getDangerReformSheet() {
        return dangerReformSheet;
    }

    public void setDangerReformSheet(DangerReformSheet dangerReformSheet) {
        this.dangerReformSheet = dangerReformSheet;
    }

    public ArrayList<Integer> getUserIds() {
        return userIds;
    }

    public void setUserIds(ArrayList<Integer> userIds) {
        this.userIds = userIds;
    }

    public Boolean getSupervise() {
        return supervise;
    }

    public void setSupervise(Boolean supervise) {
        this.supervise = supervise;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(String processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public String getProcessDefineId() {
        return processDefineId;
    }

    public void setProcessDefineId(String processDefineId) {
        this.processDefineId = processDefineId;
    }

    public Boolean getReform() {
        return reform;
    }

    public void setReform(Boolean reform) {
        this.reform = reform;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getApplyUserId() {
        return applyUserId;
    }

    public void setApplyUserId(Integer applyUserId) {
        this.applyUserId = applyUserId;
    }

    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    public Boolean getCheck() {
        return check;
    }

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public Boolean getDanger() {
        return danger;
    }

    public void setDanger(Boolean danger) {
        this.danger = danger;
    }

    public Boolean getEvaluate() {
        return evaluate;
    }

    public void setEvaluate(Boolean evaluate) {
        this.evaluate = evaluate;
    }

    public Map<String,Object> getParamsMap(){
        Map<String,Object> params=new HashMap<>();
        if(ObjectUtil.isNotNull(applyUserId)){
            params.put("applyUserId",applyUserId);
        }
        if(ObjectUtil.isNotNull(result)){
            params.put("result",result);
        }
        if(ObjectUtil.isNotNull(danger)){
            params.put("danger",danger);
        }
        if(ObjectUtil.isNotNull(check)){
            params.put("check",check);
        }
        if(ObjectUtil.isNotNull(evaluate)){
            params.put("evaluate",evaluate);
        }
        if(ObjectUtil.isNotNull(type)){
            params.put("type",type);
        }
        if(ObjectUtil.isNotNull(reform)){
            params.put("reform",reform);
        }
        if(ObjectUtil.isNotNull(taskId)){
            params.put("taskId",taskId);
        }
        if(ObjectUtil.isNotNull(processDefineId)){
            params.put("processDefineId",processDefineId);
        }
        if(ObjectUtil.isNotNull(processInstanceId)){
            params.put("processInstanceId",processInstanceId);
        }
        if(ObjectUtil.isNotNull(comment)){
            params.put("comment",comment);
        }
        if(ObjectUtil.isNotNull(supervise)){
            params.put("supervise",supervise);
        }
        if(CollectionUtil.isNotEmpty(userIds)){
            params.put("userIds",userIds);
        }
        if(ObjectUtil.isNotNull(dangerReformSheet)){
            params.put("dangerReformSheet",dangerReformSheet);
        }
        return  params;
    }
}
